package hanjia;

/**
 * Description:
 * Author:    Dane
 * CreateTime:2025/2/11-下午9:39
 * Since  :   1.0
 * Version:   1.0
 */
public class LeetCode700 {

    public TreeNode searchBST(TreeNode root, int val) {
        if (root==null){
            return null;
        }

        if (root.val==val){
            return root;
        }else if (root.val>val){
            return searchBST(root.left,val);
        }else {
            return searchBST(root.right,val);
        }

    }
}
